package com.pauldada.sakurabbs.services;

import com.pauldada.sakurabbs.dao.TaskRepository;
import com.pauldada.sakurabbs.dto.TaskUserAccount;
import com.pauldada.sakurabbs.entities.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TaskService {

    @Autowired
    TaskRepository taskRepository;

    public Task save(Task task){
        return taskRepository.save(task);
    }

    public List<Task> getAll(){
        return taskRepository.findAll();
    }

    public List<TaskUserAccount> taskUserAccounts(){
        return taskRepository.taskUserAccounts();
    }
}
